﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ResetPassword.aspx.cs" Inherits="OpSystem.ResetPassword" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>修改密码</title>
    <!-- #include file="include/header.html" -->
</head>
<body>
    <form id="form1" runat="server">
        <section class="content-header">
            <h1>修改密码<small></small></h1>
            <ol class="breadcrumb">
               
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        
                        <!-- /.box-header -->
                        <!-- form start -->
                        <div class="form-horizontal">
                            <div class="box-body">
                                <div class="form-group">
                                </div>
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">旧密码</label>
                                    <div class="col-sm-3">
                                         <input runat="server" class="form-control" type="password" name="oldpass" maxlength="12" id="oldpass" placeholder="旧密码" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputPassword3" class="col-sm-2 control-label">新密码</label>
                                    <div class="col-sm-3">
                                        <input runat="server" class="form-control" type="password" name="userpass" maxlength="12" id="userpass" placeholder="新密码" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputPassword3" class="col-sm-2 control-label">确认密码</label>
                                    <div class="col-sm-3">
                                        <input runat="server" class="form-control" type="password" name="checkpass" maxlength="12" id="checkpass" placeholder="确认密码" />
                                    </div>
                                </div>
                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer text-center">
                                <asp:Button ID="btnSave" Text="确定" runat="server" OnClick="btnSave_Click" CssClass="btn btn-primary" />
                                <button type="button" onclick="goBack();" class="btn">取 消</button>
                            </div>
                        </div>
                    </div>
                    <!-- /.box -->
                </div>

            </div>
            <!-- /.row -->
        </section>
    </form>
    <!-- #include file="include/footer.html" -->
    <script type="text/javascript">
        $(function () {
            //此处为校验的核心代码
            $("#form1").bootstrapValidator({
                submitHandler: function (valiadtor, loginForm, submitButton) {
                    valiadtor.defaultSubmit();
                },
                fields: {
                    oldpass: {
                        validators: {
                            notEmpty: {
                                message: '旧密码不能为空'
                            },
                            stringLength: {
                                /*长度提示*/
                                min: 4,
                                max: 12,
                                message: '旧密码长度必须在4到12之间'
                            }
                        }
                    },
                    userpass: {
                        validators: {
                            notEmpty: {
                                message: '新密码不能为空'
                            },
                            stringLength: {
                                /*长度提示*/
                                min: 4,
                                max: 12,
                                message: '新密码长度必须在4到12之间'
                            }
                        }
                    },
                    checkpass: {
                        validators: {
                            notEmpty: {
                                message: '确认密码不能为空'
                            },
                            identical: {
                                field: 'userpass',
                                message: '确认密码必须和新密码相同'
                            }
                        }
                    },
                }
            });

        });

        function goBack()
        {
            history.go(-1);
        }
        <%=Message%>
    </script>
</body>
</html>
